Methods and systems for using reinforcement learning for promotions

ABSTRACT

Methods and systems of using reinforcement learning for promotions. A first promotion is offered to a customer for a product and/or service. A first reward or penalty is determined, via a reinforcement machine learning model, based on the customer&#39;s reaction to the first promotion, wherein the reinforcement machine learning model is at a first state. Feedback to the reinforcement machine learning model is provided based on the first reward or penalty. A state of the reinforcement machine learning model is changed, based on the feedback, from the first state to a second state.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of U.S. application Ser. No. 16/204,321 filed Nov. 29, 2018, which claims the benefit of U.S. Provisional Application No. 62/744,508 filed Oct. 11, 2018. The entire content of these applications are incorporated herein by reference in their entirety.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1 illustrates a system for using reinforcement learning for promotions, according to an embodiment.

FIG. 2 illustrates a method for using reinforcement learning for promotions, according to an embodiment.

FIG. 3 sets forth an example learning algorithm, according to an embodiment.

FIG. 4 sets forth an example graph illustrating how a promotion can impact the likelihood of a customer making a purchase of product, according to an embodiment.

FIG. 5 sets forth an example graph illustrating an average reward per period during training, according to an embodiment.

DESCRIPTION OF EMBODIMENTS OF THE INVENTION

In some embodiments, the behavior of a model, or learner, whose task is to maximize the efficiency of promotions and ads it is generating relative to a defined reward function can be optimized. In the context of promotions, the reward function can be defined, for example, to be the revenue net costs associated with the promotion. The learner can try to learn the probability distribution underlying the customer's purchasing behavior, and the effects of promotions on this distribution, in order to maximize expected long-term rewards and therefore profit.

FIG. 1 illustrates a system for using reinforcement learning for promotions. A simulation set up module 195, a learning module 190, and a prediction module 185 can be utilized. The simulation set up module 195 can comprise stochastic modeling of the environment; a reward function definition, and a learner definition. The learning module 190 can comprise an action, an environment, a reward and/or penalty, and a learner. The prediction module 185 can comprise an optionally trained learner.

FIG. 2 illustrates a method for using reinforcement learning for promotions. In 201, a learner can observe an environment. In 202, the learner can determine and take an optional action (or multiple optimal actions), such as offering a discount or enabling a promotion, based on a current expected reward. In 203, the environment (e.g., a customer) can be impacted by the learner's action and reacts (e.g., a customer buys or does not buy a product based on a promotion). In 204, based on how the environment (e.g., customer) reacted to the action, the learner can collect a reward or a penalty. In 205, based on the reward or penalty, the learner can adapt it thinking accordingly (e.g., updates the reward or penalty). 1 thru 5 can be repeated a large number of times, until, for example, the learner's behavior has converged to an optimal behavior.

The method described herein can allow for ultra-personalization instead of relying on rough segmentation. It can be applied to optimize both discounts and non-discount promotions (e.g., recommendations, ads). A time dimension can be utilized so that the offer and the timing can be optimized. In addition, highly complex behavior can be learned by the reinforcement learning module. In some embodiments, training data and/or knowledge of the customer's historical buying activity is not required because the reinforcement learning model learns as it goes.

Example Framework

Consider a single customer facing a market with n products p∈{1, 2, . . . , n}. In some embodiments, we define the following variables as follows:

-   -   T_(p): Maximum number of periods the customer can go without         purchasing product p     -   θ∈         +: Sensitivity of the customer to promotion/ads         At each period, we define the following variables:     -   t_(p): Current number of periods since the customer last         purchased product p     -   s=[t₁, t₂, . . . t_(n)]: the state the customer is currently in,         in other word the number of periods that has passed since he         last purchased each individual product p. Note that while the         state in this model is the time since the last purchase (of each         product), it doesn't have to be in general. It can include any         changing property of a customer (e.g., a 0/1 value indicating if         a customer has responded to a promotion in the last month, brand         preference (if known), city of residence, etc.)     -   ϕ_(p)∈[0,1]: variable indicating the strength of the         promotion/ad for product p to the customer. In one embodiment,         we can restrict ϕ_(p) to take values in {0, 0.1, 0.2} in order         to reduce the size of the state-action space. We can try to keep         the model agnostic and general; in other words, we don't need to         explicitly describe what type of promotion the model will try to         generate (e.g. discount, promotion, bundling, ads, etc.) All         that can matter is that the promotion has a cost associated to         it, which increases as the strength of the promotion becomes         larger. As its strength increases, so can its effects.     -   a=[ϕ₁, ϕ₂, . . . , ϕ_(n)]: the promotion vector, also called the         action chosen by the model (e.g., what product to promote at         this period)

At the beginning of any given period, the likelihood for the customer to purchase product p can follow a Bernoulli distribution with parameter:

$\left( \frac{t_{p}}{T_{p}} \right)^{\max({0,{1 - {\theta \times \phi_{p}}}})}$

The above Bernoulli parameter can go to 1 as t_(p) increases towards T_(p). The exponent can be <1 when the model chooses ϕ_(p)>0 (e.g., generate a promotion for product p to a customer with a non-zero sensitivity θ>0). As soon as the exponent is <1, the overall value of the Bernoulli parameter can increase, making a purchase more likely.

Based on the customer's action, a state s=[t₁, t₂, . . . , t_(n)] can be updated to s′=[t′₁, t′₂, . . . , t′_(n)] as follow:

For all p∈{1, 2, . . . , n},

$t_{p}^{\prime} = \left\{ \begin{matrix} {{t_{p} + 1},} & {{if}p{}{not}{bought}} \\ {0,} & {{if}p{bought}} \end{matrix} \right.$

FIG. 4 describes how the promotion is impacting the likelihood of the customer making purchase of product p as t_(p) increase towards T_(p) as the days pass. Here T_(p)=30 and θ=3.

This distribution can (1) correspond to a consumption pattern of regularly consumed products (e.g., groceries, personal hygiene), and/or (2) impact the promotion (e.g., spread between the two curves) variant as t_(p) varies, so we can anticipate a ground truth “optimal” promotion strategy in some embodiments. An optimal promotion strategy can comprise an optimal time and/or optimal promotion details based on a certain person.

Learning Via Penalties and Rewards

A Q-matrix can map each state s∈S and each action a∈A to a value representing the expected long-term reward of choosing a given action in a given state. Taking action a∈A (e.g., offer discount for a single product but none for others) given a state s E S can push the system to a new state s′∈S (e.g., the customer does not purchase promoted product) and the learner can collect a reward that is function of a, s and s′. Based on this reward (positive vs. negative) the learner can update its Q matrix.

The reward function can penalize the learner for making a bad and ineffective promotion, and can reward it in case of success. We can introduce a new parameter representing the profit made per sale, π. During testing, the function can be defined as follow:

${R_{test}\left( {s,s^{\prime},a^{*}} \right)} = {{\pi\left( {\sum\limits_{p = 1}^{n}1_{t_{p}^{\prime} = 0}} \right)} - \left( {\sum\limits_{p = 1}^{n}\phi_{p}^{*}} \right)}$

where 1 is the indicator function,

${i.e.{}1_{t_{p}^{\prime} = 0}} = \left\{ \begin{matrix} 1 & {{{if}t_{p}^{\prime}} = 0} \\ 0 & {else} \end{matrix} \right.$

in other words, 1_(t′) _(p) ₌₀=1 if and only if the customer purchases product p. The first term can represents the profit generated by moving from state s to state s′ and the second term can be interpreted as the cost of choosing a promotion vector a*.

During training, we can modify the above reward function with additional sticks and carrots in order to further incentivize the learner:

${R_{train}\left( {s,s^{\prime},a^{*}} \right)} = {{\pi\left( {\sum\limits_{p = 1}^{n}1_{t_{p}^{\prime} = 0}} \right)} - \left( {\sum\limits_{p = 1}^{n}\phi_{p}^{*}} \right) + \left( {\sum\limits_{p = 1}^{n}{\phi_{p}^{*} \times 1_{t_{p}^{\prime} = 0}}} \right) - \left( {\sum\limits_{p = 1}^{n}{\phi_{p}^{*} \times 1_{t_{p}^{\prime} \neq 0}}} \right)}$

The first two terms above can be similar to those of R_(test)(s, s′, a*), but the third term can be >0 if the products that were promoted were also purchased (e.g., bonus) whereas the fourth term can be >0 if the products promoted were not purchased (e.g., malus).

Example Learning Algorithm

We can call the basic time unit corresponding to a single iteration of the algorithm a “day”. If there are n products, each can either be promoted or not promoted on each day. Thus, there are a total of 3^(n) possible actions (i.e. 3^(n) possible promotion vector a=[ϕ₁, ϕ₂, . . . , ϕ_(n)], since in our specific implementation ϕ_(p) takes value in {0, 0.1, 0.2} and a total N=Π_(p=1) ^(n)(T_(p)+1) possible states.

The learning algorithm (also set forth in FIG. 3) learns over time how to adapt, and can be described in some embodiments as follows:

Requires:

State space S={s₁, s₂, . . . , s_(N)} Actions space A={Φ₁, Φ₂, . . . , Φ₃n} Reward function R: S×S×A→

Stochastic transition function T: S×A→S (dictated by the customer behavior described in the framework above) Learning rate α∈[0,1] Discounting factor γ∈[0,1] Exploration factor ϵ∈[0,1]

Procedure Q Learning (S, A, R, T, α, γ, ϵ)

-   -   Initialize Q: S×A→         to a zero matrix     -   Start in state s∈S

While Q is not converged do  If U(0,1) < ϵ   Choose action a* ∈ A randomly  Else    ${{Choose}\mspace{14mu} a^{*}} = {\arg\mspace{11mu}{\max\limits_{a}{Q\left( {s,a} \right)}}}$  Compute the new state s′ ← T(s, a*)  Compute the reward r ← R(s, s′, a*)   $\left. {{Update}\mspace{14mu}{the}\mspace{14mu} Q\mspace{14mu}{matrix}\text{:}\mspace{14mu}{Q\left( {s,a} \right)}}\leftarrow{{\left( {1 - \alpha} \right){Q\left( {s,a} \right)}} + {\alpha\left( {r + {\gamma\mspace{11mu}{\max\limits_{a^{\prime}}\;{Q\left( {s^{\prime},a^{\prime}} \right)}}}} \right)}} \right.$  Update state s ← s′ Return Q

Simulation

As an example, here are the results of a simulation of the above model using the following set of parameters. Some parameters values below were picked to optimize the learning process and the results via grid search.

-   -   2 products A and B with purchasing thresholds T_(A)=7 and         T_(B)=25 respectively. These can represents the max number of         periods the customer can go without purchasing a given product.         In particular, we wanted the 2 products to have distinct         purchase frequencies: 7 days max for the first item (e.g.,         milk), and 25 days max for the other (e.g., toothpaste) to         highlight the model's ability to learn different purchasing         behaviors.     -   θ=4.95. This can represent the sensitivity of the customer to         the promotion. This example value was chosen to indicate that         the customer is fairly sensitive to the promotion (e.g., to make         the simulation interesting).     -   ϕ_(p)∈{0, 0.1, 0.2}. This variable can indicate the strength of         the promotion for product p to the customer. In this example, we         can restrict ϕ_(p) to take values in {0, 0.1, 0.2} in order to         reduce the size of the state-action space.     -   α=0.1. This can be the learning rate for the model, indicating         how much weight new information can be given in updating the         Q-matrix (e.g., the reward for taking the given action in the         current state).     -   γ=0.9. This can represent the future discount, indicating how         many future state rewards are counted as part of updating the         current reward.     -   ϵ=0.2. This can represent the exploration factor, indicating         what percentage of time the learner will chose a random action         to “explore” rather than the action that maximizes reward.     -   π=$2. This can represent the profit per sale, indicating the         positive reward given to the learner when the customer buys the         product (e.g., the total reward also can include the cost of         promotion).

The average reward per period during training can be plotted over 200,000 iterations, as shown in FIG. 5.

We can then use the trained model to test 50,000 iteration. Following the model's recommendation yields an average reward per period of $1.747. In some embodiments, this can compare to $1.141 for a random promotion policy, and $0.786 for a policy of not running any promotions.

Real Life Implementation

The model does not need to be plug-and-play in some embodiments, and implementing a reinforcement learning agent in a client context can require substantial adaptation to that context. For example, the algorithm implementation can be adapted to a client (e.g., a retailer) that seeks to optimize promotions targeted at the customer. In addition, the algorithm can adapt to customer behavior.

For example, in some embodiments, a potential client could be a retailer (e.g., WHOLE FOODS) with a large number of heterogeneous customers (e.g., with a general customer profiles such as mid 30s with 3 kids) and a promotion channel allowing quick iteration and feedback (e.g., email promotions for online shopping). In some embodiments, a customized client's reward function can be based on data such as an actual cost structure, profit margins per product, etc. The appropriate customer state space for client's customers and the relevant action space can be defined, while making sure the dimensionality of the learning problem does not blow up (e.g., too many states and/or actions). For example, if STARBUCKS was a potential client, with a customer being a person using STARBUCKS iPHONE app, lots of data about the customer (helping with customization) could be provided. However, in some embodiments, too much customization may be avoided so that too many states and/or actions are utilized in order to reduce the state space and make the algorithm more efficient (e.g., if we know that customer very likely won't be going back in 10 minutes, some states/actions accounting for short periods of time between purchases do not need to be used.

In some embodiments, a different reinforcement learning algorithm can be selected for the learning algorithm above based on the state/action space and the reward. For example, in the learning algorithm set forth above, a Q-learning algorithm was used. In other embodiments, other algorithms, such as a deep Q-learning algorithm, may be used. In still other embodiments, double Q-learning, delayed Q learning, or greedy GQ learning, or any combination of Q-learning, may be used.

Q-learning can be a reinforcement learning technique used in machine learning. A goal of Q-Learning can be to learn a policy, which tells an agent what action to take under what circumstances. It may not require a model of the environment and may be able to handle problems with stochastic transitions and rewards, without requiring adaptations. For any finite Markov decision process (FMDP), Q-learning may be able to find a policy that is optimal in the sense that it maximizes the expected value of the total reward over all successive steps, starting from the current state. Q-learning may identify an optimal action-selection policy for any given FMDP, given infinite exploration time and a partly-random policy. “Q” can name the function that returns the reward used to provide the reinforcement and can be said to stand for the “quality” of an action taken in a given state.

Deep Q-Learning learning may use experience replay, that uses a random sample of prior actions instead of the most recent action to proceed. This can remove correlations in the observation sequence and smooth changes in the data distribution. An iterative update can adjusts Q towards target values that are only periodically updated, further reducing correlations with the target.

More information on the various Q-learning algorithms can be found at the https web site en.wikipedia.org/wiki/Q-learning, which is herein incorporated by reference.

In some embodiments, scaling issues can be accounted for. In addition, in some embodiments, hyper-parameters of the reinforcement learning model can be tuned. For example, a model for one client (e.g., STARBUCKS) may not work well for another client (e.g., DUNCAN DONUTS).

While various embodiments have been described above, it should be understood that they have been presented by way of example and not limitation. It will be apparent to persons skilled in the relevant art(s) that various changes in form and detail can be made therein without departing from the spirit and scope. In fact, after reading the above description, it will be apparent to one skilled in the relevant art(s) how to implement alternative embodiments. For example, other steps may be provided, or steps may be eliminated, from the described flows, and other components may be added to, or removed from, the described systems. Accordingly, other implementations are within the scope of the following claims.

In addition, it should be understood that any figures which highlight the functionality and advantages are presented for example purposes only. The disclosed methodology and system are each sufficiently flexible and configurable such that they may be utilized in ways other than that shown.

Although the term “at least one” may often be used in the specification, claims and drawings, the terms “a”, “an”, “the”, “said”, etc. also signify “at least one” or “the at least one” in the specification, claims and drawings.

Finally, it is the applicant's intent that only claims that include the express language “means for” or “step for” be interpreted under 35 U.S.C. 112(f). Claims that do not expressly include the phrase “means for” or “step for” are not to be interpreted under 35 U.S.C. 112(f). 

1. A method of using reinforcement learning for optimizing promotions, comprising: offering a first promotion to a customer for a product and/or a service; determining, via a reinforcement machine learning model, a first reward or penalty based on the customer's reaction to the first promotion, wherein the reinforcement machine learning model is at a first state; providing feedback to the reinforcement machine learning model based on the first reward or penalty; automatically changing, based on the feedback, a state of the reinforcement machine learning model from the first state to a second state; generating a second promotion based on the reinforcement machine learning model at the second state; offering the second promotion to the customer for the product and/or the service; determining a second reward or penalty based on the customer's reaction to the second promotion; comparing the first reward or penalty with the second reward or penalty; determining a profit and cost of the promotion caused by moving from first state to second state the reinforcement machine learning model based on the comparing; and presenting a promotion for the product and/or the service based on the determining of the profit and cost.
 2. The method of claim 1, wherein the promotion is a discount.
 3. The method of claim 1, wherein the promotion is a non-discount promotion.
 4. The method of claim 1, wherein the promotion is a coupon, advertisement, or recommendation, or any combination thereof.
 5. The method of claim 1, wherein a time dimension is utilized in the reinforcement learning so that the promotion and/or the timing can be optimized.
 6. The method of claim 1, wherein a Q-learning algorithm is used in the reinforcement learning model.
 7. The method of claim 1, wherein the promotion relates to a consumption pattern of regularly consumed products.
 8. The method of claim 1, wherein the product is a regularly consumed product.
 9. The method of claim 1, wherein a deep Q-learning algorithm is used in the reinforcement learning model.
 10. The method of claim 1, wherein a double Q-learning algorithm is used in the reinforcement learning model.
 11. A system using reinforcement learning to optimizing promotions, comprising a processor and associated memory, the processor configured for: offering a first promotion to a customer for a product and/or a service; determining, via a reinforcement machine learning model, a first reward or penalty based on the customer's reaction to the first promotion, wherein the reinforcement machine learning model is at a first state; providing feedback to the reinforcement machine learning model based on the first reward or penalty; automatically changing, based on the feedback, a state of the reinforcement machine learning model from the first state to a second state; generating a second promotion based on the reinforcement machine learning model at the second state; offering the second promotion to the customer for the product and/or the service; determining a second reward or penalty based on the customer's reaction to the second promotion; comparing the first reward or penalty with the second reward or penalty; determining a profit and cost of the promotion caused by moving from first state to second state the reinforcement machine learning model based on the comparing; and presenting a promotion for the product and/or the service based on the determining of the profit and cost.
 12. The system of claim 11, wherein the promotion is a discount.
 13. The system of claim 11, wherein the promotion is a non-discount promotion.
 14. The system of claim 11, wherein the promotion is a coupon, advertisement, or recommendation, or any combination thereof.
 15. The system of claim 11, wherein a time dimension is utilized in the reinforcement learning so that the promotion and/or the timing can be optimized.
 16. The system of claim 11, wherein a Q-learning algorithm is used in the reinforcement learning model.
 17. The system of claim 11, wherein the promotion relates to a consumption pattern of regularly consumed products.
 18. The system of claim 11, wherein the product is a regularly consumed product.
 19. The system of claim 11, wherein a deep Q-learning algorithm is used in the reinforcement learning model.
 20. The system of claim 11, wherein a double Q-learning algorithm is used in the reinforcement learning model. 